[WHT]-Withholding Tax is not deducted from Expense Report lines based on the Expense Category during posting - #9973
Conversation
… on the Expense Category during posting
|
Could not find linked issues in the pull request description. Please make sure the pull request description contains a line that contains 'Fixes #' followed by the issue number being fixed. Use that pattern for every issue you want to link. |
|
Copilot resolve the merge conflicts in this pull request |
…ne' of https://github.com/ViditGupta1277/BCApps into bugs/Bug-645160-WHT-not-deducted-from-Expense-Report-Line
|
The new Suggested fix (apply manually — could not be anchored as a one-click suggestion): if CheckWithholdingTaxDisabled() then
exit;
if Rec."Expense Category" = '' then begin
Rec."Wthldg. Tax Prod. Post. Group" := '';
exit;
end;
if ExpenseCategory.Get(Rec."Expense Category") then
Rec."Wthldg. Tax Prod. Post. Group" := ExpenseCategory."Wthldg. Tax Prod. Post. Group"
else
Rec."Wthldg. Tax Prod. Post. Group" := '';Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.32.4 |
d4e3b32
…rom-Expense-Report-Line
| GLEntry: Record "G/L Entry"; | ||
| WHTEmployeeCalc: Codeunit "WHT Employee Calculation"; | ||
| begin | ||
| if not WHTPostingSetup.Get(GenJnlLine."Wthldg. Tax Bus. Post. Group", GenJnlLine."Wthldg. Tax Prod. Post. Group") then begin |
There was a problem hiding this comment.
Two independently-flagged issues compound: the buffer table is directly writable (RIMD) by any user holding only the new permission set, and PostWHTSingle/PostWHTGroup post whatever amounts are found in that buffer without validating that a posting setup exists before trusting the amount. Together, a user (or a bug) that seeds/edits buffer rows can drive incorrect G/L postings with no configuration error surfaced anywhere in the flow. Closing either gap alone still leaves the other; both the permission model and the setup validation should be hardened together.
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.32.4
| Assignable = true; | ||
| Caption = 'Expense Withholding Tax'; | ||
|
|
||
| Permissions = |
There was a problem hiding this comment.
The new assignable permission set "Exp. Withholding Tax" grants only the buffer table and two internal codeunits, but the app's setup and normal usage paths also depend on the Expense Category Card, Withholding Tax Posting Setup, and the extended General Journal page/fields. Without execute/tabledata coverage for those objects (or an equivalent included permission set), an assigned user cannot configure or use this feature without SUPER.
Knowledge:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.32.4
…ne' of https://github.com/ViditGupta1277/BCApps into bugs/Bug-645160-WHT-not-deducted-from-Expense-Report-Line # Conflicts: # build/projects/Apps CA/.AL-Go/settings.json # build/projects/Apps CZ/.AL-Go/settings.json # build/projects/Apps DK/.AL-Go/settings.json # build/projects/Apps ES/.AL-Go/settings.json # build/projects/Apps FR/.AL-Go/settings.json # build/projects/Apps GB/.AL-Go/settings.json # build/projects/Apps NO/.AL-Go/settings.json # build/projects/Apps US/.AL-Go/settings.json
|
This PR introduces a second, parallel implementation of single/group withholding-tax GL posting logic. Posting this finding as an issue comment because inline comment placement failed. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.32.4 |
|
Behavioral change to the shipped, non-local procedure Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.32.4 |
Fixes AB#645160